﻿using DotNetty.Buffers;
using QQ.Client;
using QQ.Codecs;
using QQ.Utils;
using System.Collections.Generic;

namespace QQ.Packet.Request.TLV
{
    public class TLV0x144 : IRequest
    {
        private readonly QQDeviceConfig config;
        private Dictionary<short, IByteBuffer> tlvs
        {
            get => new Dictionary<short, IByteBuffer>
                {
                    {0x109,new TLV0x109(config).Serialize() },
                    {0x52d,new TLV0x52d(config).Serialize() },
                    {0x124,new TLV0x124(config).Serialize() },
                    {0x128,new TLV0x128(config).Serialize() },
                    {0x16e,new TLV0x16e(config).Serialize() },
                };
            set
            {

            }
        }
        public TLV0x144(QQDeviceConfig config)
        {
            this.config = config;
        }
        public IByteBuffer Serialize() => QQTea.Encrypt(Unpooled.Buffer().WriteTLVS(tlvs).ToArray(), config.TgtgKey.ToArray()).ToByteBuffer();
    }
}